<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h2>扩展操作行和rest操作</h2>
</body>
<script>
    let obj = {
        name: 'alice',
        age: 20,
        address: '北京'
    }

    let obj2={
        hobby:'运动',
        xueli:'本科'
    }

    //需求：合并obj和obj2,最终效果：
   let result={...obj,...obj2}
   // let result2=Object.assign({},obj,obj2)
    
   /*
    for(let key in obj2) {
        obj[key]=obj2[key]
    }
    */

    //console.log('result:',result)

    //展开数组
    let arr=[22,33,45]
    let arr2=[444,33,22]
    let mergeArr=[...arr,...arr2]
  //  arr.push.apply(arr,arr2)
   // console.log('arr:',arr)

   function getData(title,...args) {
     console.log('title:',title)
     console.log('args:',args)
   }

   getData('显示数据：',22,33,44)
   
</script>
</html>